﻿@model PeshoMVC.Models.ChangeUserPasswordModel

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "Change password";
}

<h2>Change password</h2>

@using (Html.BeginForm("ChangePassword", "User", FormMethod.Post, new { @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()
    <hr />
    <div class="form-group">
        @Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.TextBoxFor(m => m.OldPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.OldPassword)
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.NewPassword)
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.ConfirmPassword)
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <input type="submit" value="Send" class="btn btn-default" /> |
            @Html.ActionLink("Back to List", "Index")
        </div>
    </div>

    if (ViewBag.Error != null)
    {
        <div class="alert alert-danger alert-dismissable">
            @ViewBag.Error
        </div>
    }
}